#ifndef PRINT_H
#define PRINT_H

#include <QObject>
#include <QtPrintSupport/QPrinterInfo>
#include <QStringList>

class Print : public QObject
{
    Q_OBJECT
public:
    explicit Print(QObject *parent = 0);
    ~Print();


signals:



public slots:
    QStringList availablePrinterNames() const;
    QString  defaultPrinterName() const;
    void printTrade(const QString &printName, const  QVariantMap  &jsonData);
private:
    QPrinterInfo printerInfo(const QString &printName);
    qreal printHeader(qreal mm, QPainter *painter, const QVariantMap &header);
    qreal printContent(qreal y, qreal mm, const QVariantList &list, QPainter *painter);
    void printFooter(qreal y, qreal mm, QPainter *painter, const QVariantMap &footer);
};

#endif // PRINT_H
